#include "code_def.h"
#include <string.h>
#include <stdint.h>
#define WaterLight_SPEED_VALUE 0x00c9d2ff
#define GPIO_oData  0x0020;
#define GPIO_iData  0x0024;
#define GPIO_outEn  0x0028;

void delay(int interval)
{
	int i;
	for(i=1;i<=interval;i++);
}


int main()
{ 
	//interrupt initial
	int act=1;
	NVIC_CTRL_ADDR = 0xf;

	
	//WATERLIGHT
	SetWaterLightSpeed(WaterLight_SPEED_VALUE);
	SPIstart();

	while(1){	
		

	if(act==1)
	{
	SPIwrite('C', 1);
	delay(5);
	SPIwrite('O', 1);
	delay(5);
	SPIwrite('R', 1);
	delay(5);
	SPIwrite('T', 1);
	delay(5);
	SPIwrite('E', 1);
	delay(5);
	SPIwrite('X', 1);
	delay(5);
	SPIwrite('M', 1);
	delay(5);
	SPIwrite('0', 1);
	delay(5);
	act=0;
	}

  SPIwrite('0', 0);

}
}
